﻿<UserControl x:Class="ScrumFactory.Team.MyProfile"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:props="clr-namespace:ScrumFactory.Team.Properties"
             
             xmlns:SF_Helpers="clr-namespace:ScrumFactory.Windows.Helpers;assembly=ScrumFactory.Windows.Helpers"
             
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">

    <TabControl Style="{StaticResource WindowTabControl}">
        <TabControl.Items>
            <TabItem Header="{Binding PanelName}">
                <SF_Helpers:PanelLayout Title="{Binding PanelName}" Style="{StaticResource DetailPanelLayout}">

                    <!-- TOOLBAR -->
                    <SF_Helpers:PanelLayout.Toolbar>
                        <ToolBar>
                            <MenuItem Style="{StaticResource GoBackMenuItem}"/>
                            <MenuItem  Header="{x:Static props:Resources.Change_image}" Command="{Binding ChangeAvatarCommand}">
                                <MenuItem.Icon>
                                    <Image Source="/Images/ToolBar/image.png" Width="32" Height="32" Stretch="Uniform"/>
                                </MenuItem.Icon>
                            </MenuItem>
                            
                        </ToolBar>
                    </SF_Helpers:PanelLayout.Toolbar>

                    <!-- CONTENT -->
                    <SF_Helpers:PanelLayout.Content>
                        <StackPanel Orientation="Vertical">
                            <Border Margin="0,0,0,10">
                                <TextBlock Text="{x:Static props:Resources.Profile_not_completed}"/>
                                <Border.Style>                                    
                                    <Style BasedOn="{StaticResource AlertBorder}" TargetType="Border">
                                        <Setter Property="Visibility" Value="Collapsed"/>
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding  MemberProfile.EmailAccount}" Value="{x:Null}">
                                                <Setter Property="Visibility" Value="Visible"/>
                                            </DataTrigger>
                                            <DataTrigger Binding="{Binding  MemberProfile.EmailAccount}" Value="">
                                                <Setter Property="Visibility" Value="Visible"/>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </Border.Style>
                            </Border>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="200"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="150"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="auto"/>
                                    <RowDefinition Height="auto"/>
                                    <RowDefinition Height="auto"/>
                                    <RowDefinition Height="auto"/>
                                    <RowDefinition Height="auto"/>
                                    <RowDefinition Height="auto"/>
                                </Grid.RowDefinitions>

                                <StackPanel Grid.Column="2" Grid.RowSpan="6" Orientation="Vertical">
                                    <ContentControl                                    
                                    DataContext="{Binding .}"
                                    Width="100" Height="100" Padding="6"                                                              
                                    HorizontalAlignment="Center" VerticalAlignment="Top"
                                    Style="{StaticResource MemberImageControlStyle}"/>

                                    <TextBlock Margin="8" TextWrapping="Wrap" HorizontalAlignment="Center">
                                    <Hyperlink Command="{Binding CreateAvatarCommand}">
                                        <Run Text="{x:Static props:Resources.Change_image_tooltip}" />
                                    </Hyperlink>
                                    </TextBlock>
                                </StackPanel>

                                <TextBlock Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="0">
                        <TextBlock                            
                            Style="{StaticResource LabelTextBlock}"
                            Text="{Binding MemberProfile.MemberUId}"/>    
                       
                    </TextBlock>



                                <TextBlock
                        Grid.Column="0" Grid.Row="1"
                        Style="{StaticResource LabelTextBlock}"
                        Text="{x:Static props:Resources.My_name}"/>
                                <TextBox
                        Grid.Column="1" Grid.Row="1"
                        HorizontalAlignment="Stretch"
                        Text="{Binding MemberProfile.FullName}"/>

                                <TextBlock
                        Grid.Column="0" Grid.Row="2"
                        Style="{StaticResource LabelTextBlock}"
                        Text="{x:Static props:Resources.My_email}"/>
                                <TextBox
                        Grid.Column="1" Grid.Row="2"
                        HorizontalAlignment="Stretch"
                        Text="{Binding MemberProfile.EmailAccount}"/>

                                <TextBlock
                        Grid.Column="0" Grid.Row="3"
                        Style="{StaticResource LabelTextBlock}" VerticalAlignment="Top"
                        Text="{x:Static props:Resources.My_company}"/>
                                <TextBox
                        Grid.Column="1" Grid.Row="3"
                        HorizontalAlignment="Stretch"
                        Text="{Binding MemberProfile.CompanyName}"/>

                                <TextBlock
                        Grid.Column="0" Grid.Row="4"
                        Style="{StaticResource LabelTextBlock}" VerticalAlignment="Top"
                        Text="{x:Static props:Resources.My_skills}"/>
                                <TextBox
                        Grid.Column="1" Grid.Row="4"
                        HorizontalAlignment="Stretch" Height="150" MinLines="3"
                        Text="{Binding MemberProfile.Skills}"/>

                                <TextBlock
                        Grid.Column="0" Grid.Row="5"
                        Style="{StaticResource LabelTextBlock}" VerticalAlignment="Top"
                        Text="{x:Static props:Resources.Contact_information}"/>
                                <TextBox
                        Grid.Column="1" Grid.Row="5"
                        HorizontalAlignment="Stretch" Height="150" MinLines="3"
                        Text="{Binding MemberProfile.ContactData}"/>

                            </Grid>
                        </StackPanel>
                        
                    </SF_Helpers:PanelLayout.Content>
                </SF_Helpers:PanelLayout>
            </TabItem>
        </TabControl.Items>
    </TabControl>

</UserControl>
